using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NetworkPower.DataAccess.Models.Mapping
{
    public class SeparationMap : EntityTypeConfiguration<Separation>
    {
        public SeparationMap()
        {
            // Primary Key
            this.HasKey(t => new { t.SeparationID, t.SeparationType, t.VoltageID });

            // Properties
            this.Property(t => t.SeparationType)
                .IsRequired()
                .HasMaxLength(250);

            // Table & Column Mappings
            this.ToTable("Separations");
            this.Property(t => t.SeparationID).HasColumnName("SeparationID");
            this.Property(t => t.SeparationType).HasColumnName("SeparationType");
            this.Property(t => t.VoltageID).HasColumnName("VoltageID");
        }
    }
}
